package vista;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.FlowLayout;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import controlador.ControladorBotonEmpezar;
import controlador.ControladorCargar;


public class VistaMenuPrincipal extends Vista{
	private static final long serialVersionUID = 1L;

	public VistaMenuPrincipal(){
		super (2, 3, "Nuevo Juego", 500, 500);
		crearLabelConTitulo(0, "TOWER DEFENCE");
		crearBotonConControlador(0, "Juego nuevo", new ControladorBotonEmpezar(this));
		crearBotonConControlador(1, "Cargar juego", new ControladorCargar(this));
		crearBotonConControlador(2, "Salir", new ActionListener(){

			public void actionPerformed(ActionEvent e) {
				System.exit(0);
			}			
		});
		getPanelBotones().setLayout(new FlowLayout());
		for (int i=0 ; i<3; i++){
			getPanelBotones().add(getBoton(i));
		}
		
		getLabel(0).setFont(new Font("Tahoma", 1, 25));
		getLabel(0).setForeground(new java.awt.Color(0, 0, 0));
		getLabel(0).setBackground(Color.WHITE);
		
		getPanelLabels().add(getLabel(0));
		getVentana().getContentPane().setLayout(new BorderLayout());
		getVentana().add(getPanelLabels(), BorderLayout.CENTER);
		getVentana().add(getPanelBotones(), BorderLayout.SOUTH);
		mostrarVentana();

	}

	public static void main (String[] args){
		new VistaMenuPrincipal();
	}

}

